home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d13
/
prism127.arc
/
~MATH.PGE
(
.txt
)
< prev
next >
Wrap
Microsoft Windows Help File Content
|
1990-08-01
|
2KB
|
47 lines
:begin
>.v_exist[a#] .then[intro]
>.define[a#] .define[b#] .define[c#]
>.define[a]
>.window[]
>intro
:Intro
Iris uses two types of variables: text and numeric.
Iris also supports a number of arithmetic and logical
operators.
When numeric variables are being used, the operators use
their conventional meaning. However, when text variables
are being used the meaning of the operators is slightly
different.
You can mix numeric and text variables in a calculation or
comparison whenever you want. Which "type" of operation
takes place -- text or numeric -- depends on the variable
first mentioned. Variables of another type are converted
to the "base" type.
If a text variable needs to be converted to a numeric
variable, but contains no numerals, zero is used.
Here are some sample calculations.
:calcs
>a#=10 b#=20 c#=30 a=10
numeric text
------- ----
a# = ^a# | a = ^a
>a#+1 a+1
add: a# + 1 = ^a# | append: a + 1 = ^a
>a#-1 a-1
subtract: a# - 1 = ^a# | delete: a - 1 = ^a
>a#*2 a*2
multiply: a# * 2 = ^a# | fill: a * 2 = ^a
>a#/2 a/2
divide: a# / 2 = ^a# | withdraw: a / 2 = ^a
>.pause
>a#=^b#+^c# a=^b#+^c#
numeric text
------- ----
a# = b# + c# .. ^a# = ^b# + ^c# | a = b# + c# .. ^a = ^b# + ^c#
>a#=^b#-^c# a=^b#-^c#
a# = b# - c# .. ^a# = ^b# - ^c# | a = b# - c# .. ^a = ^b# - ^c#
>a#=^b#*^c# a=^b#*^c#
a# = b# * c# .. ^a# = ^b# * ^c# | a = b# * c# .. ^a = ^b# * ^c#
>a#=^b#/^c# a=^b#/^c#
a# = b# / c# .. ^a# = ^b# / ^c# | a = b# / c# .. ^a = ^b# / ^c#